<!DOCTYPE HTML>
<html>
<head>
    
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <!--[if lt IE 9]>
    <script type="text/javascript" src="./Public/Admin/lib/html5.js"></script>
    <script type="text/javascript" src="./Public/Admin/lib/respond.min.js"></script>
    <script type="text/javascript" src="./Public/Admin/lib/PIE_IE678.js"></script>
    <![endif]-->
    <link href="./Public/Admin/css/H-ui.min.css" rel="stylesheet" type="text/css">

    <!--[if IE 6]>
    <script type="text/javascript" src="./Public/Home/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>网站后台管理系统</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <script type="text/javascript" src="./Public/Admin/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="./Public/Admin/lib/layer/1.9.3/layer.js"></script>
	<link rel="stylesheet" href="./Public/Admin/lib/layer/1.9.3/skin/layer.css" id="layui_layer_skinlayercss">

<title>-</title></head>
<body>
<style>
@media print {
.noprint { display: none; }
}
table,th,tr,td{
	margin:0;
	padding:0;
}
.labels{
	width:100px;
	float:left;
	background:none;
	color:#000;
	line-height:31px;
}
div{
	float:left;
}
span{
	float:left;
	line-height:31px;
}
span input{
	width:500px;
}
.inputs input{
	width:30px;
}
.inputs{
	width:50px;
}
input{
	border:0;
}
.input_text{
	border:0;
}
table,tr,td,th{
	border:1px solid #000;
	background:#f5fafe;
}
th{
	text-align:center !important;
	
}
th{
	font-weight:bold !important;
}
th span input{
	font-weight:normal !important;
}
.bold{
	font-weight:bold !important;
}
.bold span input{
	font-weight:normal !important;
}
.center{
	width:100%;text-align:center;
}
.center input{
	text-align:center;
}
textarea{
	font-size:8px !important;
}
.input-text{
	font-size:12px !important;
}
.input-text,input{
	height:25px !important;
	line-height:25px !important;
}
@media print {
	.noprint { display: none; }
	.input_time{
		width:120px;
	}
	.inputs{
		width:30px !important;
	}
	input{
		z-index:-1px !important;
	}
}
</style>
<div class="pd-20">
	
	<table class="table-hover" style="width:1900px;height:660px;">
		<thead>
			<tr>
				<th class="noprint"></th>
				<th scope="col" colspan="15" >
					<div style="width:430px;">
						<span style="padding-left:150px;">仓储/电商公司：</span>
						<span><input type="text" name="company" id="company" class="input-text" style="width:190px;" value="{$detail.report.company}"></span>
					</div>
					<div style="width:598px;">
						<span>杭州跨境贸易电子商务产业园（下沙）保税仓理货报告&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;201</span>
						<span><input type="text" name="year_top" id="year_top" class="input-text" style="width:15px;" value="{$detail['report']['year_top']?$detail['report']['year_top']:''}">年</span>
						<span><input type="text" name="month_top" id="month_top" class="input-text"  style="width:25px;" value="{$detail['report']['month_top']?$detail['report']['month_top']:''}">月</span>
						<span>总第<input type="text" name="no_top" id="no_top" class="input-text underline"  style="width:20px;" value="{$detail.report.no_top}">号</span>
					</div>
				</th>
				
			</tr>
			<tr>
				<th rowspan="2" class="noprint"></th>
				<th scope="col" colspan="2" rowspan="2" style="height:55px;width:230px;">转关单号(入库单号)：{$detail.order_no}</th>
				<th scope="col" colspan="4" rowspan="2" style="height:55px;width:300px;">
					<span style="margin-left:90px;">提运单号：</span>
					<span><input type="text" name="delivery_numbers" id="delivery_numbers" class="input-text" style="width:120px;" value="{$detail.report.delivery_numbers}"></span>
				</th>
				<th scope="col" colspan="7" rowspan="2" style="width:280px;">商家(账册号)：{$detail.manual_id}</th>
				<th scope="col" colspan="2" style="height:30px;width:210px;">
					<span>预录入号：</span>
					<span><input type="text" name="preentry_number" id="preentry_number" class="input-text" style="width:120px;" value="{$detail.report.preentry_number}"></span>
				</th>
				
			</tr>
			<tr>
				<th scope="col" colspan="3" style="font-size:12px;height:25px;">
				<span>到货时间：201</span>
				<span><input type="text" name="year_arrival" id="year_arrival" class="input-text underline" style="width:15px;" value="{$detail['report']['year_arrival']?$detail['report']['year_arrival']:''}">年</span>
				<span><input type="text" name="month_arrival" id="month_arrival" class="input-text underline" style="width:25px;" value="{$detail['report']['month_arrival']?$detail['report']['month_arrival']:''}">月</span>
				<span><input type="text" name="day_arrival" id="day_arrival" class="input-text underline" style="width:20px;" value="{$detail['report']['day_arrival']?$detail['report']['day_arrival']:''}">日</span>
				</th>
			</tr>
			<tr class="text-c">
				<th rowspan="2" class="noprint">入库类型</th>
				<th rowspan="2" style="width:50px;height:60px;">项号</th>
				<th rowspan="2" style="width:180px;">中文品名</th>
				<th rowspan="2" style="width:110px;">料号</th>
				<th rowspan="2" style="width:90px;">条形码</th>
				<th rowspan="2" style="width:50px;">理论<br>入库<br>数据</th>
				<th rowspan="2" style="width:50px;">单位</th>
				<th colspan="5" style="width:170px;">实际入库数量</th>
				<th colspan="2" style="width:110px;">差异数量</th>
				<th rowspan="2" style="width:210px;">差异原因</th>
				<th rowspan="2" style="width:210px;">过期时间</th>
			</tr>
			<tr class="text-c">
				<th class="inputs" >合格品</th>
				<th class="inputs" >残次品</th>
				<th class="inputs" colspan="2" >报废品</th>
				<th class="inputs" >合计</th>
				<th class="inputs" >多到货</th>
				<th class="inputs" >少到货</th>
			</tr>
		</thead>
		<tbody>
		<volist name="list" id="vo">
			<tr class="text-c goodslist"  style="height:30px;">
				<td class="noprint">
				<select class="select boundcate" name="boundcate" style="width:200px;float:left;font-size:12px;">
					<option value="0">请选择入库类型</option>
					<volist name="boundcatelist" id="vs">
						<option value="{$vs.code}"
						<if condition="$vo['bound_cate_code'] eq $vs['code']">selected</if>
						>{$vs.name}</option>
					</volist>
				</select>
				</td>
				<td style="width:50px;">{$vo.item_no}</td>
				<td>{$vo.goods_name}</td>
				<td>{$vo.source_no}</td>
				<td><span class="center"><input type="text" class="input-text bar_code" style="width:165px;" value="{$vo.bar_code}"></span></td>
				<td>{$vo.declare_amount}</td>
				<td>{$vo.declare_unit}</td>
				<td style="width:450px;">
					<span class="center"><input type="text" class="input-text conforming_p" style="width:96%;" value="{$vo['conforming_p']?$vo['conforming_p']:''}"></span>
				</td>
				<td style="width:450px;">
					<span class="center"><input type="text" class="input-text nonconforming_p" style="width:96%;" value="{$vo['nonconforming_p']?$vo['nonconforming_p']:''}"></span>
				</td>
				<td style="width:450px;">
					<span class="center"><input type="text" class="input-text scrap_one" style="width:96%;" value="{$vo['scrap_one']?$vo['scrap_one']:''}"></span>
				</td >
				<td style="width:450px;">
					<span class="center"><input type="text" class="input-text scrap_two" style="width:96%;" value="{$vo['scrap_two']?$vo['scrap_two']:''}"></span>
				</td>
				<td style="width:450px;">
					<span class="center"><input type="text" class="input-text receive_amount" style="width:96%;" value="{$vo['receive_amount']?$vo['receive_amount']:''}"></span>
				</td>
				<td style="width:450px;">
				
					<input type="text" class="input-text" style="width:96%;" value="{$vo['receive_amount']-$vo['declare_amount']>0?$vo['receive_amount']-$vo['declare_amount']:''}">
				
				</td>
				<td style="width:450px;">
				
					<input type="text" class="input-text" style="width:96%;" value="{$vo['declare_amount']-$vo['receive_amount']>0?$vo['declare_amount']-$vo['receive_amount']:''}">
				
				</td>
				<td>
					<textarea class="textarea radius mark"  name="mark" style="width:96%;height:30px;border:none;vertical-align:middle">{$vo.mark}</textarea>
				</td>
				<td style="width:450px;">
					<empty name="vo.overdue_time">
						<input type="date" name="overdue_time" class="input-text input_time" style="width:140px;" value="" >
					<else />
						<input type="date" name="overdue_time" class="input-text input_time" style="width:140px;" value="{$vo.overdue_time|date='Y-m-d',###}" >
					</empty>
				</td>
				<td class="hide goodsno">
					{$vo.goods_no}
				</td>
			</tr>
		</volist>
		<for start="0" end="$rows_c">
			<tr class="text-c goodslist" style="height:30px;">
				<td class="noprint"></td>
				<td><input type="text" class="input-text" style="width:96%;" value="" /></td>
				<td><input type="text" class="input-text" style="width:96%;" value="" /></td>
				<td><input type="text" class="input-text" style="width:96%;" value="" /></td>
				<td><input type="text" class="input-text" style="width:96%;" value="" /></td>
				<td><input type="text" class="input-text" style="width:96%;" value="" /></td>
				<td><input type="text" class="input-text" style="width:96%;" value="" /></td>
				<td>
					<input type="text" class="input-text" style="width:96%;" value="" />
				</td>
				<td>
					<input type="text" class="input-text" style="width:96%;" value="" />
				</td>
				<td style="width:50px;">
					<input type="text" class="input-text" style="width:96%;" value="" />
				</td>
				<td style="width:50px;">
					<input type="text" class="input-text" style="width:96%;" value="" />
				</td>
				<td>
					<input type="text" class="input-text" style="width:96%;" value="" />
				</td>
				<td>
					<input type="text" class="input-text" style="width:96%;" value="" />
				</td>
				<td>
					<input type="text" class="input-text" style="width:96%;" value="" />
				</td>
				<td>
					<input type="text" class="input-text" style="width:96%;" value="" />
				</td>
				<td class="hide">
					
				</td>
			</tr>
		</for>
			<tr>
				<td rowspan="2" class="noprint"></td>
				<td rowspan="2">
					合计
				</td>
				<td rowspan="2">
					
				</td>
				<td rowspan="2">
					
				</td>
				<td rowspan="2">
					
				</td>
				<td rowspan="2" style="text-align:center;">
					{$count_plan}
				</td>
				<td rowspan="2">
					
				</td>
				<td rowspan="2">
					
				</td>
				<td rowspan="2">
					
				</td>
				<td rowspan="2">
					
				</td>
				<td rowspan="2">
					
				</td>
				<td rowspan="2" style="text-align:center;">
					{$count_receive}
				</td>
				<td style="height:30px;">
					
				</td>
				<td>
					
				</td>
				<td rowspan="2">
					
				</td>
			</tr>
			<tr>
				<td colspan="2" style="height:25px;">
					<span>差异合计：</span>
					<span><input type="text" class="input-text" name="total_difference" id="total_difference" style="width:25px;" value="{$detail.report.total_difference}"></span>
				</td>
			</tr>
			<tr class="bold">
				<td class="noprint"></td>
				<td>
					<span class="labels">备注：</span>
				</td>
				<td colspan="13">
					<span style="width:100%;text-align:center;">数据单位：以向海关申报单位为准。</span>
				</td>
				
			</tr>
			<tr class="bold">
				<td class="noprint"></td>
				<td colspan="13" >
					<span class="" style="width:120px;">理货时间（日期）：</span>
					<span><input type="date" name="tally_time" id="tally_time" class="input-text input_time" style="width:140px;" value="{$detail.report.tally_time}"></span>
					<span class="">理货：</span>
					<span><input type="text" name="tally" id="tally" class="input-text" style="width:100px;" value="{$detail.report.tally}"></span>
					<span class="">理货审核：</span>
					<span><input type="text" name="tally_check" id="tally_check" class="input-text" style="width:100px;" value="{$detail.report.tally_check}"></span>
					<span class="">监盘审核：</span>
					<span><input type="text" name="plan_check" id="plan_check"  class="input-text" style="width:100px;" value="{$detail.report.plan_check}"></span>
				</td>
				<td rowspan="2">
					<span class="">报关公司：</span>
					<span><input type="text" name="customs_broker" id="customs_broker" class="input-text"  style="padding-left:3px;" value="{$detail.report.customs_broker}"></span>
				</td>
			</tr>
			<tr class="bold">
				<td class="noprint"></td>
				<td colspan="13" >
					<span class="">理货地址：</span><span><input type="text" name="tally_address" id="tally_address" class="input-text" style="width:200px" value="{$detail.report.tally_address}"></span>
					<span class="">理货公司：</span><span><input type="text" name="tally_company" id="tally_company" class="input-text" style="width:200px" value="{$detail.report.tally_company}"></span>
				</td>
			</tr>
			<tr>
				<td class="noprint"></td>
				<td colspan="14" >
					<span class="labels" style="width:50%;text-align:center;">本报告以打印版本为准，手写（或途观）无效。	</span>
					<span class="labels" style="width:50%;text-align:center;">本理货报告一式四份</span>
				</td>
				
			</tr>
		</tbody>
	</table>
	<if condition="$status eq 4">
		<input type="button" class="btn btn-success radius mt noprint" id="editmark"  value="修改">
	</if>
	<if condition="$status eq 3">
	<input type="button" class="btn btn-primary radius noprint" id="setprint"  value="打印理货报告">
	</if>
	<!-- <input type="button" class="btn btn-primary radius mt noprint" id="outboundReport"  value="入库申报"> -->
<!-- <div class="pages"> -->
<!-- {$page} -->
<!-- </div> -->
</div>
<script type="text/javascript">
    $(function(){
        /*更新打印*/
        $("#setprint").click(function(){
            $.ajax({
                type: 'POST',
                data: {plan_receipts_id:"{$detail.order_no}",id:{$detail.id},receive_no:"{$detail.receive_no}"},
                url: "{:U('printtally')}",
                success:function(data){
                    layer.msg(data.info,function(){
						return window.print();
					});
                }
            })
        });
		/*入库申报*/
        $("#outboundReport").click(function(){
            $.ajax({
                type: 'POST',
                data: {plan_receipts_id:"{$detail.order_no}",id:{$detail.id},receive_no:"{$detail.receive_no}"},
                url: "{:U('outboundReport')}",
                success:function(data){
                    layer.msg(data.info);
                }
            })
        });
		/*修改内容*/
        $("#editmark").click(function(){
			var plan_id={:I('id')};
			
			var delivery_numbers=$('input[name=delivery_numbers]').val();
			var company=$('input[name=company]').val();
			var year_top=$('input[name=year_top]').val();
			var month_top=$('input[name=month_top]').val();
			var no_top=$('input[name=no_top]').val();
			var preentry_number=$('input[name=preentry_number]').val();
			var year_arrival=$('input[name=year_arrival]').val();
			var month_arrival=$('input[name=month_arrival]').val();
			var day_arrival=$('input[name=day_arrival]').val();
			var tally_time=$('input[name=tally_time]').val();
			var tally=$('input[name=tally]').val();
			var tally_check=$('input[name=tally_check]').val();
			var plan_check=$('input[name=plan_check]').val();
			var tally_address=$('input[name=tally_address]').val();
			var tally_company=$('input[name=tally_company]').val();
			var customs_broker=$('input[name=customs_broker]').val();
			var total_difference=$('input[name=total_difference]').val();
			
			var boundcate=$(".boundcate");
			var goods_no=$('.goodsno');
			var mark=$('.mark');
			var overdue_time=$('input[name=overdue_time]');
			var conforming_p=$('.conforming_p');
			var nonconforming_p=$('.nonconforming_p');
			var scrap_one=$('.scrap_one');
			var scrap_two=$('.scrap_two');
			var receive_amount=$('.receive_amount');
			var bar_code=$('.bar_code');
			var count=$('.goodsno').length;
			var str='';
			for(var i=0;i<count;i++){
				if(boundcate.eq(i).val()==0){
					layer.msg('请选择入库类型！');
					return false;
				}
				if(i==0){
					str=str+$.trim(goods_no.eq(i).text())+":"+mark.eq(i).val()+":"+conforming_p.eq(i).val()+":"+nonconforming_p.eq(i).val()+":"+scrap_one.eq(i).val()+":"+scrap_two.eq(i).val()+":"+receive_amount.eq(i).val()+":"+bar_code.eq(i).val()+":"+boundcate.eq(i).val()+":"+overdue_time.eq(i).val();
				}else{
					str=str+","+$.trim(goods_no.eq(i).text())+":"+mark.eq(i).val()+":"+conforming_p.eq(i).val()+":"+nonconforming_p.eq(i).val()+":"+scrap_one.eq(i).val()+":"+scrap_two.eq(i).val()+":"+receive_amount.eq(i).val()+":"+bar_code.eq(i).val()+":"+boundcate.eq(i).val()+":"+overdue_time.eq(i).val();
				}
			}
			
			$.ajax({
                type: 'POST',
                data: {
						plan_id: plan_id,
						delivery_numbers: delivery_numbers,
						company: company,
						year_top: year_top,
						month_top: month_top,
						no_top: no_top,
						preentry_number: preentry_number,
						year_arrival:year_arrival,
						month_arrival: month_arrival,
						day_arrival: day_arrival,
						tally_time: tally_time,
						tally: tally,
						tally_check: tally_check,
						plan_check: plan_check,
						tally_address: tally_address,
						tally_company: tally_company,
						customs_broker: customs_broker,
						total_difference: total_difference,
						str: str
						
					  },
                url: "{:U('editmonitoring')}",
                success:function(data){
					if(data.status==1){
						layer.msg(data.message,function(){
							location.reload();
						});
					}else{
						layer.msg(data.message);
					}
                }
            })
            
        });
		
    })
</script>
<script>
 $(function(){
	$('input').css('border','0');
	$('.underline').css('border-bottom','1px solid #000');
 })
</script>
</body>
</html>